package org.mozhu.zufang.guanjia.config;

import lombok.extern.slf4j.Slf4j;
import org.mozhu.mboot.core.config.ApplicationConfiguration;
import org.mozhu.mboot.core.web.resource.CombineWebResourceConfigurer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@Slf4j
public class WebConfiguration implements WebMvcConfigurer {

    @Autowired
    CombineWebResourceConfigurer webResourceConfigurer;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        log.debug("addResourceHandlers");
        String profile = ApplicationConfiguration.get().getProperty("profile");
        log.info("profile = {}", profile);
        webResourceConfigurer.addResourceHandler(registry);
    }

}
